//
// Created by qsy on 2023/8/11.
//

#ifndef PROJECT_CHECK_READ_PIN_H
#define PROJECT_CHECK_READ_PIN_H
#include "main.h"

#define PULSE_CHN_MAX   16   // 最大的脉冲读取通道数


extern uint8_t flag;
extern uint32_t data_buf_send[16];
extern uint32_t lw_PulseCntNum[PULSE_CHN_MAX];   // 脉冲读取数存储数组

//阶梯检测
#define RASING  1         //检测阶梯上升标志
#define FALLING 0         //检测下降阶梯标志
#define STEPONE 1         //步骤1标志
#define STEPTWO 2         //步骤2标志


extern uint16_t IDR_Data1;       //上升阶梯数据存储
extern uint16_t IDR_Data2;       //下降阶梯数据存储

extern uint8_t Step_R; //上升初始步骤1
extern uint8_t Step_F; //下降初始步骤1

//上升下降阶梯标志，初始设置为上升阶梯检测
extern uint8_t RASING_FALLING;

void read_port(uint32_t * data_buf_p);
void Read_Port(uint32_t * data_buf_p,uint16_t IDR_Data);
void HandelData(uint32_t * data_buf_p);

#endif //PROJECT_CHECK_READ_PIN_H
